--[[ 编码: WMS-56-12 名称: 组盘明细 3053-点中入库任务 作者:HAN 日期:2025-1-29 级别:固定 (说明本段代码在项目中不太会变化) 函数: ClickItem 功能: -- 3053 中的功能,点中入库任务后把入库信息 加到自定义表单的{3053-组盘界面} 更改记录: --]] json = require ("json") mobox = require ("OILua_JavelinExt") m3 = require("oi_base_mobox") function ClickItem ( strLuaDEID ) local nRet, strRetInfo local data_json -- 获取点中的【组盘明细】 nRet, data_json = m3.GetSysDataJson( strLuaDEID ) if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), data_json ) end if ( #data_json ~= 1 ) then lua.Error( strLuaDEID, debug.getinfo(1), " datajson数据输入不正确 !" ) end local id = lua.trim_guid_str( data_json[1].id ) local action_array = {} local obj_attrs = m3.KeyValueAttrsToObjAttr( data_json[1].attrs ) if ( obj_attrs.S_BS_NO == nil ) then mobox.setInfo( strLuaDEID, "当前任务列表中必须有来源单号列") return end if ( obj_attrs.S_BS_TYPE == nil ) then mobox.setInfo( strLuaDEID, "当前任务列表中必须有来源单类型列") return end -- 设置面板【3053-组盘界面】中的输入信息 local action = { { action_type = "refresh_related_panel", value = { { panel_name = "组盘输入", input_parameter = { id = id, pac_no = obj_attrs.S_PAC_NO, -- 组盘号 item_code = obj_attrs.S_ITEM_CODE, item_name = obj_attrs.S_ITEM_NAME, cntr_code = obj_attrs.S_CNTR_CODE, cell_no = obj_attrs.S_CELL_NO, station = obj_attrs.S_STATION_NO, bs_no = obj_attrs.S_BS_NO, -- 来源业务单号 bs_type = obj_attrs.S_BS_TYPE, qty = lua.StrToNumber(obj_attrs.F_QTY) } }, { panel_name = "料格显示", input_parameter = { cell_no = obj_attrs.S_CELL_NO } } } } } lua.Debug( strLuaDEID, debug.getinfo(1), "JX-104-12 -- action", action ) nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) ) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo ) end end